import {BrowserRouter,NavLink,Route,} from 'react-router-dom' 
import Login from './Login'
import Home from './Home'
import News from './News'
import MyPrompt from "./MyPrompt.jsx"
const App=()=>{
	//做一个全局标识
	window.sessionStorage.setItem("user","false")	
	
	return<BrowserRouter>
	<header>
		<nav>
		<NavLink style={{margin:"10px 20px" }} to="/">首页</NavLink> 
		<NavLink style={{ margin: "10px 20px" }} to="/news">新闻</NavLink>
		<NavLink style={{ margin: "10px 20px" }} to="/login">登陆</NavLink>
	   </nav>
	</header>
		<Route component={MyPrompt}></Route>
		<Route path="/" exact component={Home}></Route>
		<Route path="/news" component={News}></Route>
		<Route path="/login" component={Login}></Route>

	</BrowserRouter>
}
export default App;